package com.PopulateDB;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class FileLocations {
	public static String statesFile = "./data/states.csv";
	public static String streetsFile = "./data/streetNames.csv";
	public static String townsFile = "./data/streetNames.csv";
	public static String firstNamesFile = "./data/firstNames.csv";
	public static String lastNamesFile = "./data/lastNames.csv";
	public static String categoriesFile = "./data/categories.csv";
	/*
	 * Title word distribution setup
	 */
	public static int titleWordsDistributionType = 0;
	public static String titleWordsDistributionFile = "./data/titleWordsDistribution.csv";
	public static int titleWordsDistributionMinSize = 1;
	public static int titleWordsDistributionMaxSize = 10;
	public static int titleWordsDistributionDifference = titleWordsDistributionMaxSize - titleWordsDistributionMinSize;
	
	public static String titleWordsWordFile = "./data/titleWords.csv";
	
	/*
	 * Item description distribution setup
	 */
	public static int descriptionWordsDistributionType = 0;
	public static String descriptionWordsDistributionFile = "./data/descriptionWordsDistribution.csv";
	public static int descriptionWordsDistributionMinSize = 10;
	public static int descriptionWordsDistributionMaxSize = 100;
	public static int descriptionWordsDistributionDifference = descriptionWordsDistributionMaxSize - descriptionWordsDistributionMinSize;
	
	/*
	 * Item quantity setup
	 */
	public static int itemQuantityDistributionType = 0;
	public static int itemQuantityDistributionMinSize = 0;
	public static int itemQuantityDistributionMaxSize = 10;
	public static int itemQuantityDistributionDifference = itemQuantityDistributionMaxSize - itemQuantityDistributionMinSize;
	
	/*
	 * number of bids per item
	 */
	public static int bidsDistributionType = 0;
	public static int bidsDistributionMinSize = 0;
	public static int bidsDistributionMaxSize = 10;
	public static int bidsDistributionDifference = bidsDistributionMaxSize - bidsDistributionMinSize;
	
	
	
	
	public static ArrayList<String> readSingleColumn(String file){
		ArrayList<String> temp = new ArrayList<String>();
			
			BufferedReader in = new BufferedReader(new InputStreamReader(MakeAddress.class.getResourceAsStream(file)));
			
			try {
				// read the data on the first column
				while(in.ready()){
					String firstWord = in.readLine().split(",")[0];
					temp.add(firstWord);
				}
				
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		return temp;
	}
}
